import request from '@/utils/request'
// 查询企业的部门列表
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
// 获取员工简单列表
export function getSimpleEmployee() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}
// 新增部门接口
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// DELETE删除接口
export function deleteDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 根据ID查询部门详情
export function getDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

// 根据ID修改部门详情
export function updateDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
